
"""
@author: xiangping
@contact: xiangpingbu@gmail.com
@time: 2020/6/22 1:45 下午
@file: gaolu_model
@Desc:
"""

from app.exts import db
from app.models.po.base_po import BasePO


class GaoLuChuTie(db.Model, BasePO):
    __tablename__ = "syn_tq_rgaoluchutie"
    __bind_key__ = "cg"
    finsid = db.Column(db.VARCHAR(50), comment='主键id', primary_key=True)
    foperatorid = db.Column(db.VARCHAR(50), comment='炉号')
    fnumber = db.Column(db.VARCHAR(50), comment='操作人')
    fbb = db.Column(db.VARCHAR(50), comment='铁次')
    fbc = db.Column(db.VARCHAR(50), comment='班别')
    fdatetime = db.Column(db.DateTime, comment='班次')
    fdate = db.Column(db.Date, comment='数据录入时间')
    fisv = db.Column(db.VARCHAR(50), comment='数据生效日期')
    fpbsj = db.Column(db.DateTime, comment='铁水类型')
    fkksj = db.Column(db.DateTime, comment='配包时间')
    fkssj = db.Column(db.DateTime, comment='开口时间')
    fjssj = db.Column(db.DateTime, comment='开始时间')
    ftk = db.Column(db.VARCHAR(50), comment='结束时间')
    ftksd = db.Column(db.FLOAT, comment='铁口')
    flltl = db.Column(db.FLOAT, comment='铁口深度')
    fyp = db.Column(db.VARCHAR(10), comment='理论铁量')
    fbz = db.Column(db.VARCHAR(10), comment='压炮')
    fdb = db.Column(db.VARCHAR(10), comment='憋渣')
    fdtdk = db.Column(db.VARCHAR(10), comment='待包')
    fjzsj = db.Column(db.DateTime, comment='带铁堵口')
    flzsj = db.Column(db.DateTime, comment='见渣时间')
    fzl = db.Column(db.FLOAT, comment='拉渣时间')
    ftkjc = db.Column(db.VARCHAR(10), comment='渣量')
    ftswd = db.Column(db.FLOAT, comment='铁口见吹')
    fsfgt = db.Column(db.VARCHAR(10), comment='铁水温度')

    def __repr__(self):
        return "gaolu_model"


class ZlJyh(db.Model, BasePO):
    __tablename__ = "syn_zl_zl_jyh"
    __bind_key__ = "cg"
    jyhid = db.Column(db.BigInteger, comment='检验行ID', primary_key=True)
    jytid = db.Column(db.BigInteger, comment='关联ZL_JYT表的JYTID')
    jcxmid = db.Column(db.BigInteger, comment='检测项目ID')
    jcxmbm = db.Column(db.VARCHAR(40), comment='检测项目编码')
    jcxmms = db.Column(db.VARCHAR(240), comment='检测项目描述')
    jcxmsx = db.Column(db.VARCHAR(40), comment='检测项目缩写')
    jcxmdw = db.Column(db.VARCHAR(40), comment='检测项目单位')
    jyjg = db.Column(db.VARCHAR(240), comment='检验结果')
    bzqj = db.Column(db.VARCHAR(80), comment='标准区间')
    xzqj = db.Column(db.VARCHAR(80), comment='限制区间')
    cgjy = db.Column(db.CHAR(1), comment='常规检验')
    lhbz = db.Column(db.CHAR(1), comment='量化标志')
    blxsw = db.Column(db.Integer, comment='保留小数位')
    jyr = db.Column(db.VARCHAR(20), comment='检验人')
    jyrxm = db.Column(db.VARCHAR(80), comment='检验人姓名')
    jyyjid = db.Column(db.VARCHAR(10), comment='检验依据ID')
    jyyj = db.Column(db.VARCHAR(10), comment='检验依据')
    zfbz = db.Column(db.VARCHAR(10), comment='0正常1作废')
    pdjg = db.Column(db.VARCHAR(10), comment='判定结果(0未判1合格2不合格)')
    xmxh = db.Column(db.VARCHAR(10), comment='项目序号')
    pdjb = db.Column(db.VARCHAR(10), comment='判定级别(0未判1合格2不合格)')
    jsbds = db.Column(db.VARCHAR(10), comment='计算表达式')
    erpbz = db.Column(db.VARCHAR(10), comment='上传ERP标志')
    bgbz = db.Column(db.VARCHAR(10), comment='报告标志')
    pdbz = db.Column(db.VARCHAR(10), comment='判定标准')
    zhpdid = db.Column(db.VARCHAR(10), comment='判定ID')
    jysj = db.Column(db.VARCHAR(10), comment='syn_zl_zl_jyt冗余字段')


class ZlJyt(db.Model, BasePO):
    __tablename__ = "syn_zl_zl_jyt"
    __bind_key__ = "cg"
    jytid = db.Column(db.BIGINT, comment="检验头ID", primary_key=True)
    qyid = db.Column(db.BIGINT, comment="取样ID（关联ZL_QY表的QYID")
    zyid = db.Column(db.BIGINT, comment="制样ID")
    jylcid = db.Column(db.BIGINT, comment="检验流程ID")
    ph = db.Column(db.VARCHAR(40), comment="批号")
    wtlx = db.Column(db.CHAR(1), comment="委托类型  ：0正常1复验2抽查")
    wlid = db.Column(db.BIGINT, comment="物料ID")
    wlbm = db.Column(db.VARCHAR(40), comment="物料编码")
    wlms = db.Column(db.VARCHAR(240), comment="物料描述")
    jysj = db.Column(db.DATETIME, comment="检验时间")
    shr = db.Column(db.VARCHAR(20), comment="审核人")
    shrxm = db.Column(db.VARCHAR(80), comment="审核人姓名")
    bz = db.Column(db.VARCHAR(200), comment="备注")
    lrr = db.Column(db.VARCHAR(20), comment="录入人")
    lrrxm = db.Column(db.VARCHAR(80), comment="录入人姓名")
    lrsj = db.Column(db.DATETIME, comment="录入时间")
    xgr = db.Column(db.VARCHAR(20), comment="修改人")
    xgrxm = db.Column(db.VARCHAR(80), comment="修改人姓名")
    xgsj = db.Column(db.DATETIME, comment="修改时间")
    tjr = db.Column(db.VARCHAR(20), comment="提交人")
    tjrxm = db.Column(db.VARCHAR(80), comment="提交人姓名")
    tjsj = db.Column(db.DATETIME, comment="提交时间")
    jygw = db.Column(db.VARCHAR(20), comment="检验岗位")
    ztbz = db.Column(db.CHAR(1), comment="状态标志：1 提交  0 保存  2 历史保存  3 历史提交  (注意:中值计算时保存为8,提交为9)")
    zfbz = db.Column(db.CHAR(1), comment="作废标志：0正常1作废")
    pdlx = db.Column(db.CHAR(1), comment="判定类型,0为正常判定，1为特殊中值判定，此字段由物料特殊判定表(zl_jszzwl)维护决定。")
    wtcs = db.Column(db.INTEGER, comment="委托次数")
    jjsj = db.Column(db.DATETIME, comment="交接时间")
    jyr = db.Column(db.VARCHAR(20), comment="接样人")
    jyrxm = db.Column(db.VARCHAR(80), comment="接样人姓名")
    syr = db.Column(db.VARCHAR(20), comment="送样人")
    syrxm = db.Column(db.VARCHAR(80), comment="送样人姓名")
    qyids = db.Column(db.VARCHAR(100), comment="取样ID集合,此字段仅用于综合检验批。保存被综合的数批的取样ID")
    cjqrbz = db.Column(db.CHAR(1), comment="采集确认标志")
    cjid = db.Column(db.BIGINT, comment="采集id（存放数据采集主表id）")
    pdid = db.Column(db.BIGINT, comment="判定ID，这一个检验结果的判定结果。在判定之后回写过来 。")
    jjid = db.Column(db.BIGINT, comment="交接id（检验交接表id）")
    wtdw = db.Column(db.BIGINT, comment="委托单位")
    wtdwmc = db.Column(db.VARCHAR(240), comment="委托单位名称")


# 上料情况表
class ShangLiaoQk(db.Model, BasePO):
    __tablename__ = "syn_tq_rshangliaoqk"
    __bind_key__ = "cg"
    fid = db.Column(db.BIGINT, comment='主键id', primary_key=True)
    fdatetime = db.Column(db.DATETIME, comment='数据录入时间')
    fdate = db.Column(db.DATE, comment='数据生效时间')
    finsid = db.Column(db.VARCHAR(50), comment='炉号')
    foperatorid = db.Column(db.VARCHAR(50), comment='操作人')
    fhour = db.Column(db.INT, comment='录入小时')
    fbatchacc = db.Column(db.FLOAT, comment='累计矿批')
    fcokebatchacc = db.Column(db.FLOAT, comment='累计焦批')
    fbatchhour = db.Column(db.FLOAT, comment='小时矿批')
    fcokebatchhour = db.Column(db.FLOAT, comment='小时焦批')
    fblockbatch = db.Column(db.FLOAT, comment='堵口批数')
    fcoalt = db.Column(db.FLOAT, comment='喷吹煤量')
    fcoalr = db.Column(db.FLOAT, comment='实际煤量')
    fcokerate = db.Column(db.FLOAT, comment='小时焦比')
    fcoalrate = db.Column(db.FLOAT, comment='小时煤比')
    ffuelrate = db.Column(db.FLOAT, comment='燃料比')
    fbomids = db.Column(db.TEXT, comment='BomIds(关联BOM消耗表MBom1)')


class GaoLuLiLunTie(db.Model, BasePO):
    __tablename__ = "syn_tq_rgaoluliluntie"
    __bind_key__ = "cg"
    fid = db.Column(db.Integer, comment="主键", primary_key=True)
    fdate = db.Column(db.Date, comment="数据生效时间")
    fdatetime = db.Column(db.DateTime, comment="创建时间")
    finsid = db.Column(db.VARCHAR(50), comment="炉号")
    fhour = db.Column(db.INT, comment="录入小时")
    fliluntie = db.Column(db.FLOAT, comment="理论铁")


class MBom1(db.Model, BasePO):
    __tablename__ = "syn_tq_mbom1"
    __bind_key__ = "cg"
    fbomid = db.Column(db.VARCHAR(100), comment="主键id", primary_key=True)
    fbomnumber = db.Column(db.VARCHAR(50), comment="BOM编号")
    fbomtype = db.Column(db.INT, comment="Bom类型（1-附加料，2-人工补偿量，3-烧结物料消耗，4-高炉物料消耗）")
    finsid = db.Column(db.VARCHAR(50), comment="炉号")
    fdate = db.Column(db.DATE, comment="数据生效时间")
    fcreattime = db.Column(db.DATETIME, comment="创建时间")
    foperatorid = db.Column(db.VARCHAR(50), comment="操作人")
    fmodifytime = db.Column(db.DATETIME, comment="修改时间")
    fitemid = db.Column(db.INT, comment="物料id（关联物料料种表MMain）")
    fparentid = db.Column(db.INT, comment="物料父id（关联物料料种表MMain）")
    fqty = db.Column(db.DECIMAL, comment="物料消耗量")
    funit = db.Column(db.VARCHAR(50), comment="单位")
    fusestatus = db.Column(db.INT, comment="使用状态")
    fnote = db.Column(db.VARCHAR(50), comment="该字段如果有逗号，例如(1号仓,13)，则逗号前面代表仓库，后面代表录入时间，如果没有逗号，例如(15)，则表示物料补偿量")


class MMain(db.Model, BasePO):
    __tablename__ = "syn_tq_mmain"
    __bind_key__ = "cg"
    fbomid = db.Column(db.BIGINT, comment="主键id", primary_key=True)
    fbomnumber = db.Column(db.VARCHAR(50), comment="操作人")
    fdate = db.Column(db.DATETIME, comment="数据生效时间")
    fitemno = db.Column(db.VARCHAR(255), comment="物料编号")
    fname = db.Column(db.VARCHAR(50), comment="物料名")
    fdaycostid = db.Column(db.BIGINT, comment="能源系统使用字段，无意义")
    fcomitemno = db.Column(db.VARCHAR(50), comment="公司编号")
    fcomitemname = db.Column(db.VARCHAR(50), comment="公司名")
    fliantiename = db.Column(db.VARCHAR(50), comment="炼铁名")
    fcomname = db.Column(db.VARCHAR(255), comment="公司名描述")
    ftypea = db.Column(db.VARCHAR(50), comment="该物料属于哪个科室（1-技术科，2-设备动力科，3-安全科，4-生产科，5-综合办公室）")
    ftypeb = db.Column(db.VARCHAR(50), comment="该物料属于哪种类型(1-原材料，2-相关辅材，3-燃料)")
    ftypec = db.Column(db.VARCHAR(50), comment="该物料属于哪种矿(1-烧结矿，2-球团矿，7-块矿，8-回收，10-")
    ftyped = db.Column(db.VARCHAR(50), comment="萤石，13-焦炭，14-焦丁，15-煤粉，16-铁料，65-熔剂，67-焦粉，68-白煤，75-皂土，76-混料，77-进出厂物料，78-机烧配比，79-进厂焦丁，80-进厂焦末，81-循环球面")
    ftypee = db.Column(db.VARCHAR(50), comment="该物料属于哪种料（8-钒钛烧结矿，9-普通烧结矿，10-竖炉球团矿，12-外购高品位钒钛球团矿，13-外购高品位钒钛球团矿，14-普通球团矿，15-高品位块矿，16-低品位块矿，17-自循环球面，19-萤石，25-自产焦，26-优质一级焦，27-普通一级焦，28-二级焦，29-焦丁，30-回收焦粉，31-烟煤，32-洗无烟沫，34-钒粉，35-普粉，36-进口粉，37-杂料，38-钙灰，39-镁灰，40-焦粉，41-白煤，46-皂土，255-潞安煤，256-双福球，257-矿焦槽除尘灰，259-优质石灰粉，260-镁石灰粉，261-高镁石灰粉，262-钙镁石灰混合粉，263-石灰粉，264-膨润土，268-回收返矿，269-锰矿石，270-南非矿石，271-神华煤，284-混料，285-焦沫，286-进出厂物料，287-添加剂，288-烧结机除尘灰，289-委瑞内拉矿石，290-干熄焦）")
    fnote = db.Column(db.VARCHAR(255), comment="物料备注")
    fprice = db.Column(db.Float, comment="物料价格")


class Batch(db.Model, BasePO):
    __tablename__ = "syn_zl_wj_batch"
    __bind_key__ = "cg"
    batch_id = db.Column(db.BIGINT, comment="主键id", primary_key=True)
    batch_ph = db.Column(db.VARCHAR(40), comment="批号")
    ect_code_one = db.Column(db.VARCHAR(20), comment="第一次加密编码")
    ect_code_two = db.Column(db.VARCHAR(20), comment="第二次加密编码")
    taskcode = db.Column(db.VARCHAR(20), comment="业务号")
    po_number = db.Column(db.VARCHAR(20), comment="订单号")
    po_linenum = db.Column(db.VARCHAR(28), comment="行号")
    provider_code = db.Column(db.VARCHAR(30), comment="供应商编码")
    provider = db.Column(db.VARCHAR(100), comment="供应商")
    materiel_id = db.Column(db.BIGINT, comment="物料ID")
    materiel_code = db.Column(db.VARCHAR(40), comment="物料编码")
    materiel = db.Column(db.VARCHAR(60), comment="物料")
    start_station = db.Column(db.VARCHAR(80), comment="发站")
    t_or_c = db.Column(db.CHAR(1), comment="汽车、火车  0汽车  1火车")
    i_or_o = db.Column(db.CHAR(1), comment="国内/进口标记  0进口1国内")
    weather = db.Column(db.VARCHAR(2), comment="天气")
    storeroom_code = db.Column(db.VARCHAR(30), comment="子库编号")
    storeroom = db.Column(db.VARCHAR(80), comment="子库")
    batch_total = db.Column(db.INT, comment="本批车数")
    vt_flag = db.Column(db.CHAR(1), comment="委托类型  0正常1复验2抽查3外委4线下3抽查5稽查6质量异议7中滦焦炭外委")
    vt_batch_id = db.Column(db.BIGINT, comment="被内委批号ID")
    vt_count = db.Column(db.INT, comment="委托次数")
    fetch_place_code = db.Column(db.VARCHAR(20), comment="取样地点编码")
    fetch_place = db.Column(db.VARCHAR(40), comment="取样地点")
    fetch_method = db.Column(db.CHAR(1), comment="取样方式:1先取样后收货   2先收货后取样  3无前后")
    dictate_dept_code = db.Column(db.VARCHAR(20), comment="指令下发单位编码")
    dictate_dept = db.Column(db.VARCHAR(40), comment="指令下发单位")
    dictate_person_code = db.Column(db.VARCHAR(20), comment="指令人编码")
    dictate_person = db.Column(db.VARCHAR(40), comment="指令人")
    dictate_time = db.Column(db.DATETIME, comment="指令时间")
    dictate_post = db.Column(db.VARCHAR(20), comment="指令岗位")
    dictate_bc = db.Column(db.BIGINT, comment="指令人班次")
    dictate_bb = db.Column(db.BIGINT, comment="指令人班别")
    dictate_remark = db.Column(db.VARCHAR(200), comment="指令备注")
    upuserid = db.Column(db.VARCHAR(20), comment="修改人编码")
    upusername = db.Column(db.VARCHAR(40), comment="修改人")
    uptime = db.Column(db.DATETIME, comment="修改时间")
    referuserid = db.Column(db.VARCHAR(20), comment="提交人编码")
    referuser = db.Column(db.VARCHAR(40), comment="提交人")
    refertime = db.Column(db.DATETIME, comment="提交时间")
    canceluserid = db.Column(db.VARCHAR(20), comment="作废人编码")
    canceluser = db.Column(db.VARCHAR(40), comment="作废人")
    canceltime = db.Column(db.DATETIME, comment="作废时间")
    cancel_flag = db.Column(db.CHAR(1), comment="作废标志(1为作废，0为不作废)")
    order_flag = db.Column(db.CHAR(1), comment="作业指令单状态标")
    audit_person_code = db.Column(db.VARCHAR(20), comment="审核人编码")
    audit_person = db.Column(db.VARCHAR(40), comment="审核人")
    audit_time = db.Column(db.DATETIME, comment="审核时间")
    audit_flag = db.Column(db.CHAR(1), comment="审核标志 0未审核1已审核")
    audit_remark = db.Column(db.VARCHAR(80), comment="审核备注")
    car_person_code = db.Column(db.VARCHAR(20), comment="线下车号录入人编码")
    car_person = db.Column(db.VARCHAR(40), comment="线下车号录入人")
    car_time = db.Column(db.DATETIME, comment="线下车号录入时间")
    car_bak = db.Column(db.VARCHAR(2000), comment="车号记录")
    weight = db.Column(db.DECIMAL, comment="线下净重(数量)")
    check_flow = db.Column(db.BIGINT, comment="检验流程")
    audit_post = db.Column(db.VARCHAR(20), comment="指令单岗位")
    pdgw = db.Column(db.VARCHAR(20), comment="判定岗位")
    zhpdjg = db.Column(db.CHAR(1), comment="综合判定结果 0 未判 1 合格 2 不合格")
    zhpdjb = db.Column(db.VARCHAR(80), comment="综合判定级别")
    pdr = db.Column(db.VARCHAR(20), comment="判定人")
    pdrxm = db.Column(db.VARCHAR(80), comment="判定人姓名")
    pdsj = db.Column(db.DATETIME, comment="判定时间")
    pdbz = db.Column(db.CHAR(1), comment="判定审核标志 0 未审核 1 已审核（可汇总上传）")
    pdshr = db.Column(db.VARCHAR(20), comment="判定审核人")
    pdshrxm = db.Column(db.VARCHAR(80), comment="判定审核始名")
    pdshsj = db.Column(db.DATETIME, comment="判定审核时间")
    pdshbz = db.Column(db.CHAR(1), comment="判定审核标志  0未审核1已审核")
    erp_flag = db.Column(db.CHAR(1), comment="上传ERP")
    erp_time = db.Column(db.DATETIME, comment="上传时间")
    erp_rst = db.Column(db.VARCHAR(240), comment="上传结果")
    check_flag = db.Column(db.VARCHAR(2), comment="检验状态  检验标记(取样/制样/检验/判定/判定审核)")
    print_count = db.Column(db.INT, comment="打印次数")
    erp_mode = db.Column(db.CHAR(1), comment="上传方式  1单项上传2算术平均")
    qybz = db.Column(db.CHAR(1), comment="取样标志  0未取样1已取样")
    bcybz = db.Column(db.CHAR(2), comment="备查样标志   无00正常01复验02抽查03外委04线下05")
    flow_flag = db.Column(db.CHAR(1), comment="复验/抽查正常流程标志  0正常 1复检 2抽查")
    jjhz_flag = db.Column(db.CHAR(1), comment="检斤汇总标志位")
    jjhz_date = db.Column(db.DATETIME, comment="检斤汇总时间")
    jjhz_rst = db.Column(db.VARCHAR(240), comment="检斤汇总结果")
    vt_batch_ph = db.Column(db.VARCHAR(40), comment="被内委批号")
    print_seq = db.Column(db.VARCHAR(20), comment="打印流水号")
    recollect_count = db.Column(db.VARCHAR(3), comment="重新汇总次数，默认为空，以后每次作废重传增加1，构成新批号后缀，格式为*01、*02,...")
    character1 = db.Column(db.VARCHAR(150), comment="存放因订单行满手工更改订单行的原错误订单行信息")
    character2 = db.Column(db.VARCHAR(150), comment="备用2   存放自动预警错误信息")
    character3 = db.Column(db.VARCHAR(150), comment="备用3   自动预警执行完毕  0:未执行自动预警   1:自动预警执行完毕   2:检验结果在预警范围内  3:检验结果不在预警范围内  4:抽查超允差  5:稽查超允差 6:未做允差判断 7:稽查抽查都超允差")
    character4 = db.Column(db.VARCHAR(150), comment="备用4   预警时间")
    character5 = db.Column(db.VARCHAR(150), comment="备用5")
    batch_ph_zy = db.Column(db.VARCHAR(40), comment="正样批号")
    ycbz = db.Column(db.CHAR(1), comment="允差标志   1在允差范围内   2不在允差范围内")
    ycsj = db.Column(db.DATETIME, comment="允差时间")
    ycjg = db.Column(db.VARCHAR(240), comment="允差结果")
    xmbz = db.Column(db.CHAR(1), comment="委托项目全否  1全  2不全")
    kzcomp_flag = db.Column(db.CHAR(1), comment="扣杂比对标志  0未比对  1 已比对")
    zjcomp_flag = db.Column(db.CHAR(1), comment="质检比对标志  0未比对  1 已比对")
    kz_rst = db.Column(db.VARCHAR(150), comment="扣杂比对结果")
    zj_rst = db.Column(db.VARCHAR(150), comment="质检比对结果")
    kz_date = db.Column(db.DATETIME, comment="扣杂比对汇总时间")
    zj_date = db.Column(db.DATETIME, comment="质检比对汇总时间")
    mid_sc_flag = db.Column(db.CHAR(1), comment="上传中间服务器标志0未上传1已上传")
    mid_sc_date = db.Column(db.DATETIME, comment="上传中间服务器时间")


class TQPD(db.Model, BasePO):
    __tablename__ = "syn_zl_zl_tqpd"
    __bind_key__ = "cg"
    pdid = db.Column(db.BIGINT, comment="判定ID", primary_key=True)
    qyid = db.Column(db.BIGINT, comment="取样ID")
    jylcid = db.Column(db.BIGINT, comment="检验流程ID")
    ph = db.Column(db.VARCHAR(40), comment="批号")
    tjsj = db.Column(db.DATETIME, comment="提交时间")
    wlid = db.Column(db.BIGINT, comment="物料ID")
    wlbm = db.Column(db.VARCHAR(40), comment="物料编码")
    wlms = db.Column(db.VARCHAR(240), comment="物料描述")
    pdjb = db.Column(db.VARCHAR(240), comment="判定级别")
    pdjg = db.Column(db.CHAR(1), comment="判定结果:1 合格 2 不合格 其他  未判定")
    pdfl = db.Column(db.VARCHAR(80), comment="判定分类")
    pdsj = db.Column(db.DATETIME, comment="判定时间")
    lrr = db.Column(db.VARCHAR(20), comment="录入人")
    lrrxm = db.Column(db.VARCHAR(80), comment="录入人姓名")
    lrsj = db.Column(db.DATETIME, comment="录入时间")
    xgr = db.Column(db.VARCHAR(20), comment="修改人")
    xgrxm = db.Column(db.VARCHAR(80), comment="修改人姓名")
    xgsj = db.Column(db.DATETIME, comment="修改时间")
    tjr = db.Column(db.VARCHAR(20), comment="提交人")
    tjrxm = db.Column(db.VARCHAR(80), comment="提交人姓名")
    erpbz = db.Column(db.CHAR(1), comment="上传ERP标志")
    scsj = db.Column(db.DATETIME, comment="上传时间")
    cgbz = db.Column(db.DATETIME, comment="上传成功标志")
    scjg = db.Column(db.VARCHAR(10), comment="上传结果")
    bz = db.Column(db.VARCHAR(240), comment="备注")
    zfbz = db.Column(db.CHAR(1), comment="作废标志：0正常1作废")
    pdr = db.Column(db.VARCHAR(20), comment="判定人")
    pdrxm = db.Column(db.VARCHAR(80), comment="判定人姓名")
    wtlx = db.Column(db.CHAR(1), comment="委托类型")
    wtcs = db.Column(db.INT, comment="委托次数")
    zyid = db.Column(db.BIGINT, comment="制样ID")
    jytid = db.Column(db.BIGINT, comment="检验头ID")
    ztbz = db.Column(db.VARCHAR(80), comment="（0:保存 1:提交 2:质保书打印保存 3:质保书打印提交 5:生成的最终上传批的状态标志，表示此批是综合生成的 20070403）（状态标志:0保存    1提交   2判定上传   5综合批委托类型；20061201）")
    pdgw = db.Column(db.VARCHAR(20), comment="判定岗位")
    jlzl = db.Column(db.DECIMAL, comment="计量重量")
    zzpdbz = db.Column(db.CHAR(1), comment="最终判定标志:0未处理  1此批为上传批  2此批为不上传批")
    jlrq = db.Column(db.DATETIME, comment="计量日期")
    zjhz_flag = db.Column(db.CHAR(1), comment="质检汇总标志位")
    zjhz_date = db.Column(db.DATETIME, comment="质检汇总时间")
    zjhz_rst = db.Column(db.VARCHAR(240), comment="质检汇总结果")
    po_num = db.Column(db.VARCHAR(40), comment="订单号")
    po_rec = db.Column(db.VARCHAR(40), comment="接收号")
    po_bcid = db.Column(db.VARCHAR(20), comment="生产班次ID")
    po_bcmc = db.Column(db.VARCHAR(40), comment="生产班次")
    po_job = db.Column(db.VARCHAR(40), comment="工单")
    po_jobtype = db.Column(db.VARCHAR(20), comment="工单类型")
    po_jobtime = db.Column(db.DATETIME, comment="工产日期")
    po_cc = db.Column(db.VARCHAR(40), comment="车次")
    po_zl = db.Column(db.DECIMAL, comment="ERP重量")
    po_kzl = db.Column(db.DECIMAL, comment="扣杂量")
    po_shdwbm = db.Column(db.VARCHAR(40), comment="收货单位")
    po_shdwmc = db.Column(db.VARCHAR(80), comment="收货单位名称")
    po_gwdwbm = db.Column(db.VARCHAR(40), comment="po_gwdwbm")
    po_gwdwmc = db.Column(db.VARCHAR(80), comment="供货单位名称")
    po_numh = db.Column(db.VARCHAR(20), comment="订单行")


class WJJYT(db.Model, BasePO):
    __tablename__ = "syn_zl_wj_jyt"
    __bind_key__ = "cg"
    jytid = db.Column(db.BIGINT, comment="检验头ID", primary_key=True)
    zyid = db.Column(db.BIGINT, comment="制样ID")
    batch_id = db.Column(db.BIGINT, comment="指令单ID（关联WJ_BATCH表BATCH_ID）")
    batch_ph = db.Column(db.VARCHAR(40), comment="批号")
    ect_code_one = db.Column(db.VARCHAR(20), comment="第一次加密编码")
    ect_code_two = db.Column(db.VARCHAR(20), comment="第二次加密编码")
    jylcid = db.Column(db.BIGINT, comment="检验流程ID")
    zygw = db.Column(db.VARCHAR(20), comment="制样岗位")
    jygw = db.Column(db.VARCHAR(20), comment="检验岗位")
    ecgw = db.Column(db.VARCHAR(20), comment="二次加密岗位")
    vt_flag = db.Column(db.CHAR(1), comment="委托类型(0 正常1 复验2抽查3外委 )")
    wlid = db.Column(db.BIGINT, comment="物料ID")
    wlbm = db.Column(db.VARCHAR(40), comment="物料编码")
    wlms = db.Column(db.VARCHAR(240), comment="物料描述")
    syr = db.Column(db.VARCHAR(20), comment="送样人")
    syrxm = db.Column(db.VARCHAR(80), comment="送样人姓名")
    jyr = db.Column(db.VARCHAR(20), comment="接样人")
    jyrxm = db.Column(db.VARCHAR(80), comment="接样人姓名")
    jjsj = db.Column(db.DATETIME, comment="交接时间")
    jjbz = db.Column(db.CHAR(1), comment="交接标志(0是未操作，1 是保存，2是提交 )")
    jysj = db.Column(db.DATETIME, comment="检验时间")
    shr = db.Column(db.VARCHAR(20), comment="(班组)审核人姓名")
    shrxm = db.Column(db.VARCHAR(80), comment="接样人姓名")
    shsj = db.Column(db.DATETIME, comment="(班组)审核时间")
    shbz = db.Column(db.CHAR(1), comment="(班组)审核标志")
    lrr = db.Column(db.VARCHAR(20), comment="录入人")
    lrrxm = db.Column(db.VARCHAR(80), comment="录入人姓名")
    lrsj = db.Column(db.DATETIME, comment="录入时间")
    xgr = db.Column(db.VARCHAR(20), comment="修改人")
    xgrxm = db.Column(db.VARCHAR(80), comment="修改人姓名")
    xgsj = db.Column(db.DATETIME, comment="修改时间")
    tjr = db.Column(db.VARCHAR(20), comment="提交人")
    tjrxm = db.Column(db.VARCHAR(80), comment="提交人姓名")
    tjsj = db.Column(db.DATETIME, comment="提交时间")
    ztbz = db.Column(db.CHAR(1), comment="状态标志")
    hywlbz = db.Column(db.CHAR(1), comment="化验/物理标志:1物理  2化学")
    zfbz = db.Column(db.CHAR(1), comment="作废标志")
    bz = db.Column(db.VARCHAR(200), comment="备注")
    vt_count = db.Column(db.INT, comment="委托次数")
    bcybz = db.Column(db.CHAR(2), comment="备查样标志  （无备查样为00，制样备样 为02，化验备查样 为03)")
    jyshr = db.Column(db.VARCHAR(20), comment="检验审核人")
    jyshrxm = db.Column(db.VARCHAR(80), comment="检验审核人姓名")
    jyshsj = db.Column(db.DATETIME, comment="检验审核时间")
    jyshbz = db.Column(db.CHAR(1), comment="检验审核标志")
    print_count = db.Column(db.INT, comment="打印次数")
    jjid = db.Column(db.BIGINT, comment="交接id（检验交接表id）")
    cjid = db.Column(db.BIGINT, comment="采集id（存放荧光数据采集主表id）")
    jgbz = db.Column(db.CHAR(1), comment="结果标志  1物理化学检验结果出具完毕   2物理化学检验结果无出具完毕")
    batch_ph_tc = db.Column(db.VARCHAR(40), comment="填充批号")
    mid_sc_flag = db.Column(db.CHAR(1), comment="中间服务器上传标志   0未上传   1已上传")
    mid_sc_date = db.Column(db.DATETIME, comment="中间服务器上传时间")


class WJJYH(db.Model, BasePO):
    __tablename__ = "syn_zl_wj_jyh"
    __bind_key__ = "cg"
    jyhid = db.Column(db.BIGINT, comment="检验行ID", primary_key=True)
    jytid = db.Column(db.BIGINT, comment="检验头ID（关联WJ_JYT表JYTID）")
    jcxmid = db.Column(db.BIGINT, comment="检测项目ID")
    jcxmbm = db.Column(db.VARCHAR(40), comment="检测项目编码")
    jcxmms = db.Column(db.VARCHAR(240), comment="检测项目描述")
    jcxmsx = db.Column(db.VARCHAR(40), comment="检测项目缩写")
    jcxmdw = db.Column(db.VARCHAR(40), comment="检测项目单位")
    jyjg = db.Column(db.VARCHAR(240), comment="检验结果")
    bzqj = db.Column(db.VARCHAR(80), comment="标准区间")
    xzqj = db.Column(db.VARCHAR(80), comment="限制区间")
    cgjy = db.Column(db.CHAR(1), comment="常规检验")
    lhbz = db.Column(db.CHAR(1), comment="量化标志 Y量化")
    blxsw = db.Column(db.INT, comment="保留小数位")
    jyr = db.Column(db.VARCHAR(20), comment="检验人")
    jyrxm = db.Column(db.VARCHAR(80), comment="检验人姓名")
    jyyjid = db.Column(db.BIGINT, comment="检验依据ID")
    jyyj = db.Column(db.VARCHAR(40), comment="检验依据")
    xmxh = db.Column(db.BIGINT, comment="项目序号")
    pdjg = db.Column(db.CHAR(1), comment="判定结果(0未判1合格2不合格)")
    pdjb = db.Column(db.VARCHAR(80), comment="判定级别(0未判1合格2不合格)")
    jsbds = db.Column(db.VARCHAR(250), comment="计算表达式")
    bgbz = db.Column(db.CHAR(1), comment="报告标志")
    fee = db.Column(db.DECIMAL, comment="检验费用")
    pdbz = db.Column(db.VARCHAR(200), comment="判定标准")
    sf_flag = db.Column(db.CHAR(1), comment="与水分有关")
    erp_flag = db.Column(db.CHAR(1), comment="上传ERP")
    erp_time = db.Column(db.DATETIME, comment="上传时间")
    erp_rst = db.Column(db.VARCHAR(240), comment="上传结果")
    lrr = db.Column(db.VARCHAR(20), comment="录入人")
    lrrxm = db.Column(db.VARCHAR(80), comment="录入人姓名")
    lrsj = db.Column(db.DATETIME, comment="录入时间")
    xgr = db.Column(db.VARCHAR(20), comment="修改人")
    xgrxm = db.Column(db.VARCHAR(80), comment="修改人姓名")
    xgsj = db.Column(db.DATETIME, comment="修改时间")
    tjr = db.Column(db.VARCHAR(20), comment="提交人")
    tjrxm = db.Column(db.VARCHAR(80), comment="提交人姓名")
    tjsj = db.Column(db.DATETIME, comment="提交时间")
    zfbz = db.Column(db.CHAR(1), comment="作废标志  0正常1作废")
    ztbz = db.Column(db.CHAR(1), comment="状态标志  0录入1保存2提交")
    qzfw = db.Column(db.VARCHAR(40), comment="判定审核受控范围")
    xyxsw = db.Column(db.INT, comment="修约小数位")
    xyjg = db.Column(db.VARCHAR(240), comment="修约结果")
    yjqj = db.Column(db.VARCHAR(80), comment="预警区间")
    yjjg = db.Column(db.CHAR(1), comment="预警结果(0未预警  1合格  2不合格)")
    jyshsj = db.Column(db.DATETIME, comment="syn_zl_wj_jyt冗余字段")

# class ShangLiaoQingKuang(db.Model, BasePO):
#     fid = db.Column(db.INT, comment='主键id')
#     fdatetime = db.Column(db.DateTime, comment='数据录入时间')
#     fdate = db.Column(db.Date, comment='数据生效时间')
#     finsid = db.Column(db.VARCHAR(50), comment='炉号')
#     foperatorid = db.Column(db.VARCHAR(50), comment='操作')
#     fhour = db.Column(db.INT,comment='录入小时')
#     fbatchacc = db.Column(db.FLOAT,comment='累计矿批')
#     fcokebatchacc = db.Column(db.FLOAT,comment='累计焦批')
#     fbatchhour = db.Column(db.FLOAT,comment='小时矿批')
#     fcokebatchhour = db.Column(db.FLOAT,comment='小时焦批')
#     fblockbatch = db.Column(db.FLOAT,comment='堵口批数')
#     fcoalt = db.Column(db.FLOAT,comment='喷吹煤量')
#     fcoalr = db.Column(db.FLOAT,comment='实际煤量')
#     fcokerate = db.Column(db.FLOAT,comment='小时焦比')
#     fcoalrate = db.Column(db.FLOAT,comment='小时煤比')
#     ffuelrate = db.Column(db.FLOAT,comment='燃料比')
#     fbomids = db.Column(db.TEXT,comment='关联BOM消耗表MBom1')
